package org.apache.pdfbox.arktaohtml.Utils;

import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class ImageUtils {

    /**
     * 用二进制写出图片,保存到文件去
     */
    public static boolean writeByteimg(byte []imgs,String path) {
        DataOutputStream outimg=null;
        try {
            outimg=new DataOutputStream(new FileOutputStream(path));
            outimg.write(imgs);
            outimg.flush();
            return true;
        } catch (IOException e) {
            e.printStackTrace();
            return false;
        } finally {
            try {
                outimg.close();
                return true;
            } catch (IOException e) {
                e.printStackTrace();
                return false;
            }

        }
    }

}
